﻿@{
    ViewBag.Title = ViewData["SiteName"] + " - " + ViewData["PageTitle"];
    Layout = "~/RazorThemes/Default/Views/Shared/_Layout.cshtml";
}
<div class="contentpage-outerdiv">
    @Html.ValidationSummary()
    @using (Html.BeginForm())
    {
        <h2>
            Role Management</h2>
    <br />
    <p>
        <b>Total Number of Roles: </b>@ViewData["TotalRoles"].ToString()</p>
    <hr />
    <p>
        Add New Role: @Html.TextBox("newRole") <button type="submit" id="user-manageRole-button">Add Role</button>
    </p>
    <hr />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="data-table">
        <tr>
            <th align="center">
                Role Name
            </th>
            <th>
                &nbsp;
            </th>
            <th>
                &nbsp;
            </th>
        </tr>
        @foreach (String role in System.Web.Security.Roles.GetAllRoles())
        {
            <tr>
                <td>
                    @role
                </td>
                <td align="center">
                    @if (role != "Admin" && role != "Editor" && role != "PortalAdmin" && role != "Contributor" && role != "User" & role != "Guest")
                    {
                        @Html.ActionLink("Del", "ManageRoles", "Account", new { id = role }, null)
                    }
                    
                </td>
                <td>
                    @Html.ActionLink("Add/Remove Users", "AddRemoveUsersInRole", "Account", new { id = role }, null)
                </td>
            </tr>
        }
    </table>
    }
</div>
